/**
 * @author xiaobyu
 * @created Mar 28, 2016
 * 
 */
package nconv.utils;

public class Pair<T, E>
{
  public T first;
  public E second;
  
  public Pair(T first, E second) {
    this.first = first;
    this.second = second;
  }
  
  public Pair(){
    
  }
  
  public String toString() {
    return "Pair[" + first + ", " + second + "]";
  }
  
  public int hashCode() {
    return first.hashCode() ^ second.hashCode();
  }
  
  public boolean equals(Object o) {
    if (o == null || !(o instanceof Pair<? ,?>)) {
      return false;
    }
    
    return first.equals(((Pair)o).first) && second.equals(((Pair)o).second);
  }
}